package com.volunteer.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.volunteer.entity.UserCollection;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * 收藏Mapper接口
 */
@Mapper
public interface CollectionMapper extends BaseMapper<UserCollection> {

    /**
     * 根据活动ID和用户ID查询收藏记录
     */
    @Select("SELECT * FROM t_collection WHERE activity_id = #{activityId} AND user_id = #{userId} LIMIT 1")
    UserCollection selectByActivityAndUser(Long activityId, Long userId);
}
